c.t_id=d.t_id left joins student A on a.s_id=b.s_id where D.tname= ' Zhang San '; /*dense_rank () */select E.s_id,e.c_id,e.score from (select s_id, c_id, Score,dense_rank () over (partition by c_id ORDER BY s_id) Rank1 from SC) e left joins course C on e.c_id=c.c_id left joins teacher D on c.t_id=d.t_id where D.tname= ' Zhang San '
and e.rank1=1; Select Top 1* from (select s_id, c_id, Score,dense_rank () up (partition by c_id ORDER by s_id) Rank1 from SC E left J
Oin course C on e.c_id=c
Recently learned SQL in Teradata environment. Here to record the study of the knowledge points, as a record.Directory:
About SQL learning and the online database used
Table Union (join)
SQL Sub-query
Create a new field at select (as, Case time)
Data Grouping (group BY + aggregate function count
The substring function in SQL is used to grab a portion of a field data. The name of this function is not exactly the same in different repositories:
Mysql:substr (), SUBSTRING ()
Oracle:substr ()
SQL server:substring ()
The substring function in
Substring function is used for SQL Server operations.
Substring (expression, start, length)
ParametersExpressionString, binary string, text, image, column, or expression that contains a column. Do not use expressions that contain aggregate functions.
StartAn integer or expression that can be implicitly converted to an int indicates the start position of the
Substring function is used for SQL Server operations.SUBSTRING (expression, start, length)ParametersExpressionString, binary string, text, image, column, or expression that contains a column. Do not use expressions that contain aggregate functions.StartAn integer or expression that can be implicitly converted to an int indicates the start position of the substring.LengthAn integer or expression that can be
Function:Returns part of a character, binary, text, or image expression.
Syntax:Substring (expression, start, length)
The substring function in SQL is used to capture part of a column. The function names are not exactly the same in different databases:
Parameters:
Expression string, binary string, text, image, column, or expression that contains a column. Do not use expressions that contain aggrega
Function:Returns part of a character, binary, text, or image expression.
Syntax:Substring (expression, start, length)
The substring function in SQL is used to capture part of a column. The function names are not exactly the same in different databases:
MySQL: substr (), substring ()
ORACLE: substr ()
SQL
1, SUBSTRING (operation of the string, the beginning of the position of interception, the number of characters returned)For example:Return ' CCC ' from ' ABBCCC ', charindex function usage (charindex (Find string, found string, position to start finding), for example find ' ABBCCC ' where the first ' C ' appears, CHARINDEX (' C ', ' ABBCCC ', 1))1 Declare @str1 varchar(255)2 Declare @str2 varchar(255)3 Set @str1 = 'ABBCCC'4 Set @str2 =
No matterProgramIt is still a stored procedure, so we need to develop a good habit of commenting!Not long-winded. Update a set filename = substring (filename, charindex ('/', filename) + 1, Len (filename ))Ha ~ Recently, I like databases and regular expressions!
Raiserror
Severity Level of message association defined by the user. You can use a severity level ranging from 0 to 18. The severity levels between 19 and 25 can only beSysAdminUsed by fix
function: returns part of a character, binary, text, or image expressionSyntax: SUBSTRING (expression, start, length)the substring function in SQL is used to grab a portion of a field data. The name of this function is not exactly the same in different repositories:
Mysql:substr (), SUBSTRING ()
Oracle:sub
Announcement: QQ group: 124766907, if you are in. the NET field has unique insights and profound programming skills. It has expertise in a certain field. You are welcome to join this group. This group already has several MVPs, In the SL ,. NET, BS has accomplished people welcome to the group. If you have more than 4 years of experience, do not add it. This group is pursuing the high-end and top-level products. Thank you.
Today, we mainly use the SUBSTRING
function: returns part of a character, binary, text, or image expression
Syntax: SUBSTRING (expression, start, length)
the substring function in SQL is used to grab a portion of a field data. The name of this function is not exactly the same in different repositories:
Parameters:
Expression a string, binary string, text, image, column, or expression that cont
null result Select SUBSTRING (' ABCDE ', 0,8) returns the result as ABCDE, noting that there are no spaces behind it. (2) if the index of start starts at 1 (0 or negative ), the return length is equal to 1, the intercept length is the absolute value (start-1), and if the difference is negative, the return is empty . Draw a diagram to understand this situation (e.g. substring (' ABCDE ', 0,2) returns a): Co
Tags: str span SQL statement pad Head for graph POS syntax The substring function in SQL is used to grab a portion of a field data. The name of this function is not exactly the same in different repositories:
Mysql:substr (), SUBSTRING ()
Oracle:substr ()
SQL
--The first parameter is the string to be intercepted, the second argument is truncated from the first character, and the third argument is the length of the Intercept.--For example: Select SUBSTRING (' 12345678 ', 1,4) returns 1234--Select SUBSTRING (' 12345678 ', 0,4) returns 123Select SUBSTRING (' 12345678 ', 1,4)Grammar The CHARINDEX (expression1, Expression2
The substring function in SQL is used to grab a portion of a field data. The name of this function is not exactly the same in different repositories:
Mysql:substr (), SUBSTRING ()
Oracle:substr ()
SQL server:substring ()
The most commonly used methods are as follows (here we use SUBSTR () as an ex
The SUBSTRING function was used when manipulating SQL Server
SUBSTRING (expression, start, length)
Parameters
Expression
A string, binary string, text, image, column, or an expression that contains a column. Do not use an expression that contains aggregate functions.
Start
An integer or an expression that can be implicitly converted to int, specifying the start
The substring function in SQL is used to grab a portion of a field data. The name of this function is not exactly the same in different repositories:
Mysql:substr (), SUBSTRING ()Oracle:substr ()SQL server:substring ()The most commonly used approach is as follows (here we use substr () as an example):
SUBSTR (Str,pos
Tags: code str extract pre Character div weight substr nbspThe substring function in SQL is used to intercept a portion of a field in the data. For example, we need to extract the ' Abd ' from the string ' Abdcsef ', which can be implemented using substring: Select substring ('abdcsef',1,3) Results: ' Abd ' The number
Tags: intercept oom property Remove Images class base where likeThe substring function in SQL is used to intercept a portion of a field in the data. For example, we need to extract the ' Abd ' from the string ' Abdcsef ', which can be implemented using substring: SUBSTRING ('abdcsef',1,3) Results: 'abd' The number
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.